#include <stdlib.h>

int cmp(int *a, int *b) {
    return *a - *b;
}

void merge(int *nums1, int nums1Size, int m, int *nums2, int nums2Size, int n) {
    for (int i = 0; i != n; ++i) {
        nums1[m + i] = nums2[i];
    }
    qsort(nums1, nums1Size, sizeof(int), (int (*)(const void *, const void *)) cmp);
}

int main() {
    int m = 3, A[6] = {1, 2, 3, 0, 0, 0}, B[3] = {2, 5, 6}, n = 3;
    int ret[6] = {0};
    merge(A, 6, 3, B, 3, 3);
}